<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!--================================================================================
  Item Name: Materialize - Material Design Admin Template
  Version: 4.0
  Author: PIXINVENT
  Author URL: https://themeforest.net/user/pixinvent/portfolio
================================================================================ -->

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="msapplication-tap-highlight" content="no">
    <!--<meta name="description" content="Materialize is a Material Design Admin Template,It's modern, responsive and based on Material Design by Google. ">-->
    <!--<meta name="keywords" content="materialize, admin template, dashboard template, flat admin template, responsive admin template,">-->
    <title>BAUHINIA SQUARE Admin</title>
    <!-- Favicons-->
    <link rel="icon" href="images/favicon/favicon-32x32.png" sizes="32x32">
    <!-- Favicons-->
    <link rel="apple-touch-icon-precomposed" href="images/favicon/apple-touch-icon-152x152.png">
    <!-- For iPhone -->
    <meta name="msapplication-TileColor" content="#00bcd4">
    <meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">
    <!-- For Windows Phone -->
    <!-- CORE CSS-->
    <link href="css//materialize.css" type="text/css" rel="stylesheet">
    <link href="css//style.css" type="text/css" rel="stylesheet">
    <!-- Custome CSS-->
    <link href="css/custom/custom.css" type="text/css" rel="stylesheet">
    <!-- INCLUDED PLUGIN CSS ON THIS PAGE -->
    <link href="vendors/perfect-scrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet">
    <link href="vendors/flag-icon/css/flag-icon.min.css" type="text/css" rel="stylesheet">
</head>

<body ng-app="materializeApp" class="active-member">
<!-- Start Page Loading -->
<div id="loader-wrapper">
    <div id="loader"></div>
    <div class="loader-section section-left"></div>
    <div class="loader-section section-right"></div>
</div>
<!-- End Page Loading -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START HEADER -->
<header id="header" class="page-topbar">
    <!-- start header nav-->
    <div class="navbar-fixed" th:include="header :: header"></div>
    <!-- end header nav-->
</header>
<!-- END HEADER -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START MAIN -->
<div id="main">
    <!-- START WRAPPER -->
    <div class="wrapper">
        <!-- START LEFT SIDEBAR NAV-->
        <aside id="left-sidebar-nav" th:include="leftNavigation :: navigation">
        </aside>
        <!-- END LEFT SIDEBAR NAV-->
        <!-- //////////////////////////////////////////////////////////////////////////// -->
        <!-- START CONTENT -->
        <section id="content">
            <!--breadcrumbs start-->
            <div id="breadcrumbs-wrapper">
                <div class="container">
                    <div class="row">
                        <div class="col s10 m6 l6">
                            <h5 class="breadcrumbs-title">会员列表</h5>
                            <ol class="breadcrumbs">
                                <li><a href="/">上海紫荆广场</a>
                                </li>
                                <li><a href="#">会员</a>
                                </li>
                                <li class="active">会员 列表</li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
            <!--breadcrumbs end-->
            <!-- //////////////////////////////////////////////////////////////////////////// -->
            <!--start container-->
            <div class="container">
                <!--<form method="POST" enctype="multipart/form-data" action="/shops" data-parsley-validate>-->
                <!--<div class="section">-->
                <!--<div class="row">-->
                <!--<div class="input-field col s2">-->
                <!--<select id="industry_id" name="industry_id">-->
                <!--<option th:each="industry:${industries}" th:value="${industry?.industry_id}" th:text="${industry?.industry_name}"></option>-->
                <!--</select>-->
                <!--</div>-->
                <!--<div class="col s1"></div>-->
                <!--<div class="input-field col s2">-->
                <!--<select id="map_id" name="map_id">-->
                <!--<option th:each="map:${maps}" th:value="${map.map_id}" th:text="${map.map_name}"></option>-->
                <!--</select>-->
                <!--</div>-->
                <!--<div class="col s2"></div>-->
                <!--<div class="input-field col s3">-->
                <!--<i class="material-icons prefix" style="margin-left: 1.5em">search</i>-->
                <!--<input type="text" name="Search" style="padding-left:2.5em;" />-->
                <!--</div>-->
                <!--</div>-->
                <!--<br>-->
                <!--<div class="divider"></div>-->
                <!--</div>-->
                <!--<br>-->

                <div class="row">
                    <div class="col s12 m12 l12">
                        <div class="card-panel">
                            <h4 class="header2">会员列表<a href="/export_members" class="waves-effect waves-light" target="_blank" style="margin-left:.7em">
                                <i class="material-icons">cloud_download</i>
                            </a></h4>
                            <div class="row">
                                <div class="col s12">
                                    <div class="row">
                                        <table class="striped centered">
                                            <thead>
                                            <tr>
                                                <th>手机号码</th>
                                                <th>会员姓名</th>
                                                <th>会员等级</th>
                                                <th>会员性别</th>
                                                <th>累计消费</th>
                                                <th>累计积分</th>
                                                <th>可用积分</th>
                                                <th>车牌信息</th>
                                                <th>注册时间</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr th:each="member:${members}">
                                                <td th:text="${member?.mobile}"></td>
                                                <td th:text="${member?.name}"></td>
                                                <td th:text="${member?.level}"></td>
                                                <td th:text="${member?.sex_name}"></td>
                                                <td th:text="${member?.cumulate_amount}"></td>
                                                <td th:text="${member?.cumulate_points}"></td>
                                                <td th:text="${member?.usable_points}"></td>
                                                <td th:text="${member?.carNumber}"></td>
                                                <td th:text="${#dates.format(member?.regist_date, 'yyyy-MM-dd HH:mm')}"></td>
                                                <td th:text="${T(com.laf.manager.enums.MemberStatus).valueOf(member?.status).theName()}"></td>
                                                <td><a class="waves-effect waves-light"
                                                       th:href="@{'/member?memberId=' + ${member?.member_id}}"><i
                                                        class="material-icons left">pageview</i></a></td>
                                                <!--<a class="waves-effect waves-light"-->
                                                <!--th:href="@{'/member?memberId=' + ${member?.member_id}}"><i-->
                                                <!--class="material-icons left">person</i></a>-->
                                                <!--<a class="waves-effect waves-light"-->
                                                <!--th:href="@{'/member?memberId=' + ${member?.member_id}}"><i-->
                                                <!--class="material-icons left">person_outline</i></a></td>-->
                                            </tr>
                                            </tbody>
                                            <thead><tr th:if="${members?.size()!=0}"><td style="padding:0;height:16px"></td></tr></thead>
                                            <thead style="border-bottom: none">
                                            <tr th:if="${members?.size()!=0}">
                                                <th>总计</th>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <th th:text="${#numbers.formatDecimal(amount,1,2)}"></th>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <th th:text="'共 '+${pageMap['total']}+' 条'"></th>
                                            </tr>
                                            </thead>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col s12">
                                    <div class="row" ng-controller="PaginationController" th:object="${pageMap}">
                                        <pagination class="right" th:attr="page=''+ *{index}+'',total=''+*{total}+''"
                                                    page-size="10" show-prev-next="true" dots="...."
                                                    hide-if-empty="false" adjacent="2" scroll-top="false"
                                                    pagination-action="changePage(page)"/>
                                        <div class="right input-field"  style="width:80px;" >
                                            <input id="btnJump"  type="text" />
                                            <label> 回车跳转</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="card-panel" id="coupons-panel">
                            <h4 class="header2">优惠券列表</h4>
                            <div class="row">
                                <div class="col s12">
                                    <div class="row">
                                        <table class="striped centered">
                                            <thead>
                                            <tr>
                                                <th></th>
                                                <th>券名称</th>
                                                <th>券类型</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr th:each="coupon:${coupons}">
                                                <td><input type="checkbox" th:value="${coupon?.coupon_id}" th:id="|cbox${coupon?.coupon_id}|" class="filled-in coupon-selected"><label th:for="|cbox${coupon?.coupon_id}|"></label></td>
                                                <td th:text="${coupon?.coupon_name}"></td>
                                                <td>推送型</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="row">
                                        <div class="col s12">
                                            <button id="btn-push" class="waves-effect waves-light btn right" style="margin-top:2em;"><i
                                                    class="material-icons right">done</i>推送
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--</form>-->
            </div>
            <!--end container-->
        </section>
        <!-- END CONTENT -->
        <!-- START RIGHT SIDEBAR NAV-->
        <aside id="right-sidebar-nav" th:include="rightSidebarNav :: right-sidebar-nav">
        </aside>
        <!-- END RIGHT SIDEBAR NAV-->

        <div class="fixed-action-btn" style="top: 80px; right: 19px;">
            <a class="btn-floating btn-large modal-trigger" href="#data-filter">
                <i class="material-icons">local_bar</i>
            </a>
        </div>

        <!-- Floating Action Button -->
        <!--<div class="fixed-action-btn" style="bottom:50px; right:19px;">-->
        <!--<a class="btn-floating btn-large">-->
        <!--<i class="material-icons">add</i>-->
        <!--</a>-->
        <!--<ul>-->
        <!--<li>-->
        <!--<a href="#data-filter" class="btn-floating blue modal-trigger">-->
        <!--<i class="material-icons">local_bar</i>-->
        <!--</a>-->
        <!--</li>-->
        <!--<li>-->
        <!--<a href="cards-extended.html" class="btn-floating green">-->
        <!--<i class="material-icons">card_membership</i>-->
        <!--</a>-->
        <!--</li>-->
        <!--<li>-->
        <!--<a href="app-calendar.html" class="btn-floating amber">-->
        <!--<i class="material-icons">today</i>-->
        <!--</a>-->
        <!--</li>-->
        <!--<li>-->
        <!--<a href="app-email.html" class="btn-floating red">-->
        <!--<i class="material-icons">mail_outline</i>-->
        <!--</a>-->
        <!--</li>-->
        <!--</ul>-->
        <!--</div>-->
        <!-- Floating Action Button -->
    </div>

    <div id="data-filter" class="modal bottom-sheet">
        <div class="modal-content">
            <!--<h4>Modal Header</h4>-->
            <span class="btn-floating btn modal-trigger" disabled style="margin-left:.8em">
                <i class="material-icons">find_in_page</i>
            </span>
            <span id="filter-reset" class="btn-floating btn right modal-trigger" style="margin-left:.8em">
                <i class="material-icons">find_replace</i>
            </span>
            <!--<form id="form-filter" action="/tickets/filter" method="post" data-parsley-validate>-->
            <form id="form-filter" action="/members/filter" method="post">
                <div class="row">
                    <div class="col s12">
                        <div class="row">
                            <div class="input-field col s6">
                                <input id="username" name="username"
                                       type="text" data-parsley-ui-enabled="false">
                                <label for="username">会员姓名</label>
                            </div>
                            <div class="input-field col s6">
                                <input id="mobile" name="mobile" class="validate" type="tel"
                                       pattern="(^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$)"
                                       data-parsley-pattern="(^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$)"
                                       data-parsley-pattern-message="字段内容不是正确的手机号格式">
                                <label for="mobile">会员手机号</label>
                            </div>
                        </div>

                        <div class="row">
                            <div class="input-field col s6">
                                <input id="carNumber" name="carNumber"
                                       type="text" data-parsley-ui-enabled="false">
                                <label for="carNumber">车牌号</label>
                            </div>
                            <div class="input-field col s6">
                                <input id="birthdayMonth" name="birthdayMonth"
                                       type="text" data-parsley-ui-enabled="false">
                                <label for="birthdayMonth">生日月份</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <input id="cumulateAmountStart" name="cumulateAmountStart"
                                       type="number" step="0.01" min="0" value="0">
                                <label for="cumulateAmountStart">累计消费(区间起始)</label>
                            </div>
                            <div class="input-field col s6">
                                <input id="cumulateAmountEnd" name="cumulateAmountEnd" class=""
                                       type="number" step="0.01" min="0" value="0">
                                <label for="cumulateAmountEnd">累计消费(区间结束)</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <input id="cumulatePointsStart" name="cumulatePointsStart"
                                       type="number" step="1" min="0" value="0">
                                <label for="cumulatePointsStart">累计积分(区间起始)</label>
                            </div>
                            <div class="input-field col s6">
                                <input id="cumulatePointsEnd" name="cumulatePointsEnd" class=""
                                       type="number" step="1" min="0" value="0">
                                <label for="cumulatePointsEnd">累计积分(区间结束)</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6" ng-controller="DateController">
                                <input input-date type="text" ng-model="currentTime" container="body"
                                       format="yyyy-mm-dd"
                                       months-full="{{ month }}" months-short="{{ monthShort }}"
                                       weekdays-full="{{ weekdaysFull }}" weekdays-short="{{ weekdaysShort }}"
                                       weekdays-letter="{{ weekdaysLetter }}"
                                       disable="disable" min="{{ minDate }}" max="{{ maxDate }}"
                                       today="today" clear="clear" close="close" select-years="10"
                                       data-parsley-ui-enabled="false"
                                       id="register-date-start" name="register-date-start" class="do-points">
                                <label for="register-date-start">注册时间(开始)</label>
                            </div>
                            <div class="input-field col s6" ng-controller="DateController">
                                <input input-date type="text" ng-model="currentTime" container="body"
                                       format="yyyy-mm-dd"
                                       months-full="{{ month }}" months-short="{{ monthShort }}"
                                       weekdays-full="{{ weekdaysFull }}" weekdays-short="{{ weekdaysShort }}"
                                       weekdays-letter="{{ weekdaysLetter }}"
                                       disable="disable" min="{{ minDate }}" max="{{ maxDate }}"
                                       today="today" clear="clear" close="close" select-years="10"
                                       data-parsley-ui-enabled="false"
                                       id="register-date-end" name="register-date-end" class="do-points">
                                <label for="register-date-end">注册时间(结束)</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <div class="input-field col s6" ng-controller="DateController">
                                    <select name="birthday-start-month" id="birthday-start-month">
                                        <option value="-1">会员生日月份(开始)</option>
                                        <option ng-repeat="x in month track by $index" value="{{$index + 1}}">{{x}}</option>
                                    </select>
                                </div>
                                <div class="input-field col s6">
                                    <input input-date type="text" id="birthday-start-day" name="birthday-start-day" class="do-points">
                                    <label for="birthday-start-day">会员生日日期(开始)</label>
                                </div>
                            </div>
                            <div class="input-field col s6">
                                <div class="input-field col s6" ng-controller="DateController">
                                    <select name="birthday-end-month" id="birthday-end-month">
                                        <option value="-1">会员生日月份(结束)</option>
                                        <option value="1">一月</option>
                                        <option value="2">二月</option>
                                        <option value="3">三月</option>
                                        <option value="4">四月</option>
                                        <option value="5">五月</option>
                                        <option value="6">六月</option>
                                        <option value="7">七月</option>
                                        <option value="8">八月</option>
                                        <option value="9">九月</option>
                                        <option value="10">十月</option>
                                        <option value="11">十一月</option>
                                        <option value="12">十二月</option>
                                    </select>
                                </div>
                                <div class="input-field col s6">
                                    <input input-date type="text" id="birthday-end-day" name="birthday-end-day" class="do-points">
                                    <label for="birthday-end-day">会员生日日期(结束)</label>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <select id="level" name="level">
                                    <option value="-1" selected>所有等级</option>
                                    <option th:text="${level?.level_name}" th:value="${level?.level_id}" th:each="level:${levels}"></option>
                                </select>
                            </div>
                            <div class="input-field col s6">
                                <select id="occupation" name="occupation">
                                    <option th:value="${occu.value()}" th:text="${occu.occuName()}" th:each="occu:${T(com.laf.manager.enums.Occupation).values()}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <select id="status" name="status">
                                    <option th:text="${status.theName()}" th:value="${status.value()}" th:each="status:${T(com.laf.manager.enums.MemberStatus).values()}"></option>
                                </select>
                            </div>
                            <div class="input-field col s6">
                                <select id="sex" name="sex">
                                    <option value="" selected>无</option>
                                    <option th:text="男" th:value="0"></option>
                                    <option th:text="女" th:value="1"></option>
                                </select>
                                <label for="sex">性别</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <select id="sort" name="sort">
                                    <option value="-1" selected>排序</option>
                                    <option th:text="累计积分" th:value="1"></option>
                                </select>
                            </div>
                            <div class="input-field col s6">
                                <select id="asc" name="asc">
                                    <option value="-1" selected>无</option>
                                    <option th:text="升序" th:value="1"></option>
                                    <option th:text="降序" th:value="2"></option>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="input-field col s6">
                                <input id="count" name="count"
                                       type="text" data-parsley-ui-enabled="false">
                                <label for="count">显示及推送数量</label>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col s12">
                                <button type="button" id="filter-button" name="filter-button"
                                        class="waves-effect waves-light btn right">
                                    <i class="material-icons left">local_bar</i>筛&emsp;选
                                </button>
                            </div>
                        </div>
                        <input type="hidden" id="registerDateStart" name="registerDateStart" value="">
                        <input type="hidden" id="registerDateEnd" name="registerDateEnd" value="">
                        <input type="hidden" id="birthdayStart" name="birthdayStart" value="">
                        <input type="hidden" id="birthdayEnd" name="birthdayEnd" value="">
                        <input type="hidden" id="page" name="page" value="">
                        <input type="hidden" id="size" name="size" value="">
                        <input type="hidden" id="filterJson" name="filterJson" value="">
                    </div>
                </div>
            </form>
            <form action="/members/reset" id="form-reset" method="post"></form>
            <form action="/members/pushCoupons" id="form-coupon-push" method="post">
                <input hidde id="ids" name="ids" value="">
            </form>
        </div>
    </div>
    <!-- END WRAPPER -->
</div>
<!-- END MAIN -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START FOOTER -->
<footer class="page-footer gradient-45deg-light-cyan-cyan" th:include="footer :: footer">
</footer>
<!-- END FOOTER -->
<!-- ================================================
Scripts
================================================ -->
<!-- jQuery Library -->
<script type="text/javascript" src="vendors/jquery-3.2.1.min.js"></script>
<!--angularjs-->
<script type="text/javascript" src="vendors/angular.min.js"></script>
<script type="text/javascript" src="vendors/angular-materialize.js"></script>
<!--materialize js-->
<script type="text/javascript" src="js/materialize.min.js"></script>
<!--scrollbar-->
<script type="text/javascript" src="vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<!--plugins.js - Some Specific JS codes for Plugin Settings-->
<script type="text/javascript" src="js/plugins.js"></script>
<!--custom-script.js - Add your own theme custom JS-->
<script type="text/javascript" src="js/angular-ui.js"></script>
<!--custom-script.js - Add your own theme custom JS-->
<script type="text/javascript" src="js/custom-script.js"></script>

<script type="text/javascript" src="js/advanced-ui-modals.js"></script>

<script th:inline="javascript">
    $(document).ready(function () {
        var filterData = /*[[${session.members_filterJson}]]*/ undefined
        if (filterData) {
            //log(filterData)
            $('#filterJson').val(filterData)
            JSON.parse(filterData, function(key, value) {
                switch (key) {
                    case 'username':
                        $('#username').val(value)
                        break
                    case 'mobile':
                        $('#mobile').val(value)
                        break
                    case 'carNumber':
                        $('#carNumber').val(value)
                        break
                    case 'birthdayMonth':
                        $('#birthdayMonth').val(value)
                        break
                    case 'registerDateStart':
                        $('#register-date-start').val(dateString(new Date(value)))
                        $('#registerDateStart').val(value)
                        break
                    case 'registerDateEnd':
                        $('#register-date-end').val(dateString(new Date(value)))
                        $('#registerDateEnd').val(value)
                        break
                    case 'level':
                        $('#level').val(value)
                        $('#level').material_select()
                        break
                    case 'occupation':
                        $('#occupation').val(value)
                        $('#occupation').material_select()
                        break
                    case 'cumulateAmountStart':
                        $('#cumulateAmountStart').val(value)
                        break
                    case 'cumulateAmountEnd':
                        $('#cumulateAmountEnd').val(value)
                        break
                    case 'cumulatePointsStart':
                        $('#cumulatePointsStart').val(value)
                        break
                    case 'cumulatePointsEnd':
                        $('#cumulatePointsEnd').val(value)
                        break
                    case 'birthdayStart':
                        $('#birthday-start-day').val(dateDayString(new Date(new Number(value))))
                        $('#birthday-start-month').val(dateMonthString(new Date(new Number(value))))
                        $('#birthday-start-month').material_select()
                        $('#birthdayStart').val(value)
                        break
                    case 'birthdayEnd':
                        $('#birthday-end-day').val(dateDayString(new Date(new Number(value))))
                        $('#birthday-end-month').val(dateMonthString(new Date(new Number(value))))
                        $('#birthday-end-month').material_select()
                        $('#birthdayEnd').val(value)
                        break
                    case 'status':
                        $('#status').val(value)
                        $('#status').material_select()
                        break
                    case 'sort':
                        $('#sort').val(value)
                        $('#sort').material_select()
                        break
                    case 'asc':
                        $('#asc').val(value)
                        $('#asc').material_select()
                        break
                    case 'count':
                        $('#count').val(value)
                        break
                    case 'sex':
                        $('#sex').val(value)
                        $('#sex').material_select()
                        break
                }
            })

//            $('select').material_select();
        }

        // 跳转
        $('#btnJump').bind('keyup', function(event) {
            var index = $("#btnJump").val();
            if (event.keyCode == "13") {
                var $index = index;

                var isNotNull = document.getElementById('form-filter')

                if (isNotNull) {
                    if ($('#page')) {
                        $('#page').val(parseInt($index))
                    }

                    if ($('#size')) {
                        $('#size').val(10)
                    }

                    $('#form-filter').submit()
                } else {
                    var pageObj = {
                        'index': $index,
                        'size': 10,
                        'total': 1000,
                    }

                    $('#pageJson').val(JSON.stringify(pageObj))

                    $('#pageForm').submit()
                }
            }
        })

        $('#filter-button').on('click', function (event) {
            var obj = {}
            if ($('#username').val()) obj.username = $('#username').val()
            if ($('#mobile').val()) obj.mobile = $('#mobile').val()
            if ($('#carNumber').val()) obj.carNumber = $('#carNumber').val()
            if ($('#birthdayMonth').val()) obj.birthdayMonth = $('#birthdayMonth').val()


            if ($('#register-date-start').val() && $('#register-date-end').val()) {
                $('#registerDateStart').val(Number(dateToMilliseconds($('#register-date-start').val())))
                $('#registerDateEnd').val(Number(dateToMilliseconds($('#register-date-end').val())))
                obj.registerDateStart = Number($('#registerDateStart').val())
                obj.registerDateEnd = Number($('#registerDateEnd').val())
            }

            if ($('#level').val() > -1) obj.level = $('#level').val()
            if ($('#occupation').val() > -1) obj.occupation = $('#occupation').val()

            if ($('#cumulateAmountStart').val() && $('#cumulateAmountEnd').val()) {
                if ($('#cumulateAmountStart').val() > 0) obj.cumulateAmountStart = $('#cumulateAmountStart').val()
                if ($('#cumulateAmountEnd').val() > 0) obj.cumulateAmountEnd = $('#cumulateAmountEnd').val()
            }

            if ($('#cumulatePointsStart').val() && $('#cumulatePointsEnd').val()) {
                if ($('#cumulatePointsStart').val() > 0) obj.cumulatePointsStart = $('#cumulatePointsStart').val()
                if ($('#cumulatePointsEnd').val() > 0) obj.cumulatePointsEnd = $('#cumulatePointsEnd').val()
            }

            var birthStartMonth = $('#birthday-start-month option:selected').val();
            var birthStartDay = $('#birthday-start-day').val();
            if(birthStartMonth && birthStartDay){
                console.log(birthStartDay.length)
                if(birthStartMonth <10) birthStartMonth = "0" + birthStartMonth
                if(birthStartDay.length == 1) birthStartDay = "0" + birthStartDay
                var birthStart = birthStartMonth + "-" + birthStartDay
                $('#birthdayStart').val(mdToMilliseconds(birthStart))
                obj.birthdayStart = $('#birthdayStart').val()
                obj.Start = birthStart
            }
            var birthEndMonth = $('#birthday-end-month option:selected').val();
            var birthSEndDay = $('#birthday-end-day').val();
            if(birthEndMonth && birthSEndDay){
                if(birthEndMonth <10) birthEndMonth = "0" + birthEndMonth
                if(birthSEndDay.length == 1) birthSEndDay = "0" + birthSEndDay
                var birthEnd = birthEndMonth + "-" + birthSEndDay
                $('#birthdayEnd').val(mdToMilliseconds(birthEnd))
                obj.birthdayEnd = $('#birthdayEnd').val()
                obj.End = birthEnd
            }

            if ($('#status').val() > -1) {
                obj.status = $('#status').val()
            }

            obj.sort = $('#sort').val()
            obj.asc = $('#asc').val()
            obj.count = $('#count').val()
            obj.sex = $('#sex').val()

            $('#filterJson').val(JSON.stringify(obj))
            $('#page').val(1)
            $('#size').val(10)

            log('-------------')
            log($('#createDateStart').val())
            log($('#createDateEnd').val())

            $('#form-filter').submit()
        })

        $('#filter-reset').on('click', function() {
            $('#form-reset').submit()
        })

        $('#btn-push').on('click', function() {
            var members = /*[[${#lists.size(members)}]]*/ 0

            if (members <= 0) {
                return false
            }

            var ids = '';
            var cbs = document.getElementsByClassName('coupon-selected')

            for (var i = 0; i < cbs.length; i++) {
                var $cb = cbs[i]

                if ($cb.checked) {
                    ids += $cb.value + ','
                }
            }

            if(ids) {
                $('#ids').val(ids)
                $('#form-coupon-push').submit()
            }
        })
    })

</script>

</body>

</html>